package qzy.security;

import java.util.Collection;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import qzy.entity.SysUser;

public class SysUserDetails implements UserDetails {
	private static final long serialVersionUID = -138002257961612872L;
	private SysUser sysUser;
	private Collection<? extends GrantedAuthority> authorities;
	public SysUserDetails(SysUser sysUser,Collection<? extends GrantedAuthority> authorities) {
		this.sysUser = sysUser;
		this.authorities = authorities;
	}

	@Override
	public Collection<? extends GrantedAuthority> getAuthorities() {
		return authorities;
	}

	@Override
	public String getPassword() {
		return sysUser.getPassword();
	}

	@Override
	public String getUsername() {
		return sysUser.getUsername();
	}

	@Override
	public boolean isAccountNonExpired() {
		return false;
	}

	@Override
	public boolean isAccountNonLocked() {
		return false;
	}

	@Override
	public boolean isCredentialsNonExpired() {
		return false;
	}

	@Override
	public boolean isEnabled() {
		return false;
	}


}
